Repository navigation
Conversation
|
(@lymereJ my apologies, I pushed a commit to test something out on a branch that causes diffs. If it's acting funny at all, I'll revert it back out in the morning.) |
|
@lymereJ Is this ready for a closer look? |
|
@mitchute - Short answer, no, It's not complete. I'm not sure if I'll have time to get to it before the upcoming release. If we could keep it open, that would be great. There's another piece to it that I have not pushed yet (I might create a different issue/PR for it) and I'm not sure that I like the proposed changes even though it addresses the issue. |
| if (CapacitanceWater > 0 && | ||
| state.dataPlnt->PlantLoop(waterCoil.WaterPlantLoc.loopNum).LoopSide(DataPlant::LoopSideLocation::Supply).FlowRequest > 0) { | ||
| TempWaterOut = TempWaterIn - HeatingCoilLoad / CapacitanceWater; | ||
| } |
There was a problem hiding this comment.
This is hurting my brain a little bit. The concept of cycling fan is that the outlet condition will be full output and the mass flow rate will be averaged based on PLR. For constant fan mass flow is full flow and outlet conditions are averaged. In both cases energy is conserved. So the question is whether air and water mass flow rate is averaged here for cycling fan. At line 2837 and 2838 you see that the air and water flow rate is bumped up to full flow, for LOCAL variables, but the node data still holds the averaged values. So to also average the water outlet temp means that the impact of PLR is applied twice. Why wasn't this also done for outlet air temperature? I think a simple check of air-side energy versus water side energy will show the correct values (i.e., either this was correct before or it's correct now). I think this change breaks the energy conservation rule. Think about line 2905, it's averaging the coil output because it's cycling fan, and HeatingCoilLoad was calculated at full capacity ... using LOCAL adjusted variables for air and water mass flow rate. The outlet water temp, and air temp, in this case should be full capacity output. Also, what the heck does plant FlowRequest have to do with this calculation?
Coil:Heating:Water for cycling operationsCoil:Heating:Water energy balance and loop flow issues with constant flow plant loops
…des, clamp pump minimum flow, set `MinAvail` demand side of series plants and warn for parallel
|
|
|
lymereJ
left a comment
There was a problem hiding this comment.
The new proposed changes are much different than what was originally in this PR. They now cover four main topics and are discussed in the code walk-through below.
The proposed changes address the two issues from #11058 as demonstrated in the plots below:
Defect files converted to 27.1: defect_files_27.1.zip
Regression show slight convergence diffs for two files, I ran annual simulations locally and do not see any diffs in reported energy use.
| // Water outlet state based on the actual water flow rate through the coil | ||
| if (HeatingCoilLoad != 0.0 && waterCoil.InletWaterMassFlowRate > DataBranchAirLoopPlant::MassFlowTolerance) { | ||
| TempWaterOut = TempWaterIn - HeatingCoilLoad / (Cp * waterCoil.InletWaterMassFlowRate); | ||
| waterCoil.OutletWaterEnthalpy = waterCoil.InletWaterEnthalpy - HeatingCoilLoad / waterCoil.InletWaterMassFlowRate; | ||
| } | ||
|
|
There was a problem hiding this comment.
The water outlet temperature and enthalpy are now computed from the PLR-scaled coil load and the actual node water flow. With a cycling fan, the outlet water temperature used to be the full-output value. That's only correct if the node flow is the PLR-averaged flow. When the plant pushes more water through the coil, the water side gave up full-capacity heat while the air received PLR × capacity. When the node flow is the PLR-averaged flow, results are the same as before.
| if (PumpMassFlowRateMin > PumpMassFlowRateMax) { // the demand side wants to operate outside of the pump range | ||
| // shut the pump (and the loop) down | ||
| PumpMassFlowRateMin = 0.0; | ||
| PumpMassFlowRateMax = 0.0; | ||
| // Let the user know that his input file is overconstrained | ||
| if (PumpMassFlowRateMin > PumpMassFlowRateMax) { // the demand side cannot accept the pump's minimum flow | ||
| PumpMassFlowRateMin = PumpMassFlowRateMax; |
There was a problem hiding this comment.
When the pump minimum flow exceeds the maximum flow the loop can accept, the minimum is now set to that maximum instead of setting both to zero. Previously, any overshoot shut down the pump and the loop for the whole simulation, silently. This includes overshoots caused only by density conversions of the same design volume flow: the pump uses Constant::InitConvTemp (5.05 °C), while AirLoopHVAC:UnitarySystem sets the coil's maximum water flow using Constant::HWInitConvTemp (60 °C). The pump still shuts off when no flow is available (maximum = 0).
| mdot = this->HeatCoilWaterFlowRatio * this->MaxHeatCoilFluidFlow; | ||
| } | ||
| state.dataLoopNodes->Node(this->HeatCoilFluidInletNode).MassFlowRate = mdot; | ||
| PlantUtilities::SetComponentFlowRate(state, mdot, this->HeatCoilFluidInletNode, this->HeatCoilFluidOutletNodeNum, this->HeatCoilPlantLoc); |
There was a problem hiding this comment.
The water flow request is now set through SetComponentFlowRate instead of being written directly to the coil inlet node. The direct write ignored the plant's flow limits (MinAvail/MaxAvail), so the coil could be simulated with a flow it wasn't receiving.
| // Supply side flow exceeds the demand side request and the demand side has no bypass | ||
| if (this->plantLoc.loopSideNum == DataPlant::LoopSideLocation::Supply) { | ||
| auto &loop = state.dataPlnt->PlantLoop(this->plantLoc.loopNum); | ||
| auto &demandSide = loop.LoopSide(DataPlant::LoopSideLocation::Demand); | ||
| Real64 const excessFlow = ThisLoopSideFlow - demandSide.flowRequestFinal; | ||
| if (!demandSide.BypassExists && loop.CommonPipeType == DataPlant::CommonPipeType::No && | ||
| excessFlow > DataBranchAirLoopPlant::MassFlowTolerance) { | ||
| if (!demandSide.Splitter.Exists || demandSide.Splitter.TotalOutletNodes == 1) { | ||
| // Series demand side: pass the forced flow as MinAvail so components see the flow they receive | ||
| auto &outletNode = state.dataLoopNodes->Node(this->NodeNumOut); | ||
| outletNode.MassFlowRateMinAvail = max(outletNode.MassFlowRateMinAvail, min(ThisLoopSideFlow, outletNode.MassFlowRateMaxAvail)); | ||
| } else if (!state.dataGlobal->WarmupFlag) { | ||
| // Parallel demand side branches: forced flow is not passed to the components | ||
| if (demandSide.errIndex_ForcedDemandFlow == 0) { | ||
| ShowWarningError(state, | ||
| std::format("{}=\"{}\": the loop flow rate is greater than the flow rate requested by the demand side " | ||
| "components,", | ||
| DataPlant::loopTypeNames[static_cast<int>(loop.TypeOfLoop)], | ||
| loop.Name)); | ||
| ShowContinueError(state, | ||
| "and the demand side has no bypass branch, so the excess flow is forced through the demand side branches."); | ||
| ShowContinueError(state, | ||
| "This typically happens when supply side equipment operates at a constant flow rate (e.g., Boiler:HotWater " | ||
| "with Boiler Flow Mode = ConstantFlow, or a pump with Pump Control Type = Continuous)."); | ||
| ShowContinueError(state, | ||
| "The results of the demand side components may be inaccurate (e.g., the loop demand may not match the " | ||
| "energy delivered by the demand side components). Add a bypass branch on the demand side of the loop."); | ||
| ShowContinueErrorTimeStamp(state, ""); | ||
| } | ||
| ShowRecurringWarningErrorAtEnd(state, | ||
| std::format("{}=\"{}\": the loop flow rate is greater than the flow rate requested by the " | ||
| "demand side components, continues...", | ||
| DataPlant::loopTypeNames[static_cast<int>(loop.TypeOfLoop)], | ||
| loop.Name), | ||
| demandSide.errIndex_ForcedDemandFlow, | ||
| excessFlow, | ||
| excessFlow, | ||
| _, | ||
| "[kg/s]", | ||
| "[kg/s]"); | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
When the supply side drives the loop flow above the demand side's request, for example with a ConstantFlow boiler, and the demand side has no bypass:
- Series demand side (no splitter, or a single-outlet splitter): the loop flow is passed to the demand side as
MinAvail, the same mechanism used for a pump's minimum flow. Demand components are then simulated with the flow they actually receive. - Parallel demand branches: the excess flow can't be passed to the individual branches, so a warning is issued suggesting a demand-side bypass.
| TEST_F(EnergyPlusFixture, WaterCoils_CyclingHeatingCoil_ConstantFlowBoilerWithoutDemandBypass) | ||
| { | ||
| ASSERT_TRUE(process_idf(hotWaterLoopWithoutDemandBypassIdf(false))); | ||
| SimulationManager::ManageSimulation(*state); | ||
| checkHotWaterCoilEnergyBalance(*state); | ||
| } | ||
|
|
||
| TEST_F(EnergyPlusFixture, WaterCoils_CyclingHeatingCoil_ContinuousPumpWithoutDemandBypass) | ||
| { | ||
| // pump minimum flow rate (5.05 C density) exceeds the coil maximum flow rate set by the unitary system (60 C density) | ||
| ASSERT_TRUE(process_idf(hotWaterLoopWithoutDemandBypassIdf(true))); | ||
| SimulationManager::ManageSimulation(*state); | ||
| EXPECT_GT(state->dataLoopNodes->Node(state->dataPumps->PumpEquip(1).OutletNodeNum).MassFlowRate, 0.0); | ||
| checkHotWaterCoilEnergyBalance(*state); | ||
| } |
There was a problem hiding this comment.
New unit tests mimicking the defect files, we check for energy balance between loop and coil.
|
Pull request overview
Flow Mode#11058Pull Request Author
Reviewer